$(document).ready(function(){
    if ($('#editDatesLink')[0]){
        //Edit Date Label
        var searchResultsResetForm = $('#searchResultsResetForm')[0];
        var editDateCal = new SW.widget.Calendar.StayCalendarInput({
            trigger: $('#editDatesLink').get(0),
            checkIn: searchResultsResetForm.elements.arrivalDate,
            checkOut: searchResultsResetForm.elements.departureDate,
            searchForm: searchResultsResetForm,
            submitFormOnGo: true
        });
        $("#editDatesIcon").on("click",function(e){
            e.preventDefault();
            editDateCal.showCalendar(e);
        })
        editDateCal.initialize();
    }
});